//
//  UIView + CornerRadius.swift
//  Edaixi-iOS
//
//  Created by 刘树华 on 2017/12/7.
//  Copyright © 2017年 刘树华. All rights reserved.
//

import Foundation

extension UIView {
    
    func makeCircular()  {
        
        self.layer.cornerRadius = self.width/2
        
    }
    func makeRoundCorners(corner:UIRectCorner,radius:CGFloat)  {
      let maskPath =  UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corner, cornerRadii: CGSize(width: radius, height: radius))
       let maskLayer = CAShapeLayer()
        maskLayer.frame = self.bounds
        maskLayer.path = maskPath.cgPath
        self.layer.mask = maskLayer
        
    }
    
    
}
